package org.mwielocha.jxcube.tasks;

public abstract class AbstractTask implements ITask {

  private TaskStatus status = TaskStatus.WAITING;
  
  @Override
  public TaskStatus getStatus() {
    return status;
  }
  
  @Override
  public void setStatus(TaskStatus status) {
    this.status = status;
    System.out.println(status);
  }
  
  protected boolean isRunning() {
    return getStatus() == TaskStatus.RUNNING;
  }
  
  protected boolean isCanceling() {
    return getStatus() == TaskStatus.CANCELING;
  }
  
  public boolean isCanceled() {
    return getStatus() == TaskStatus.CANCELED;
  }
}
